<template>
  <el-dialog :visible.sync="visible" title="详情" :close-on-click-modal="false" :close-on-press-escape="false">
    <el-form :model="dataForm" ref="dataForm" :label-width="$i18n.locale === 'en-US' ? '120px' : '120px'">
	  <el-form-item label="创建时间">
		  <el-input disabled v-model="dataForm.createTime"></el-input>
      </el-form-item>
          <el-form-item label="商品名称" prop="commodityName">
          <el-input disabled v-model="dataForm.commodityName"></el-input>
      </el-form-item>
          <el-form-item label="商品个数" prop="goodsNum">
          <el-input disabled v-model="dataForm.goodsNum"></el-input>
      </el-form-item>
          <el-form-item label="商品价格" prop="goodsPrice">
          <el-input disabled v-model="dataForm.goodsPrice"></el-input>
      </el-form-item>
      </el-form-item>
          <el-form-item label="实际发货数量" prop="sendGoodsNum">
          <el-input disabled v-model="dataForm.sendGoodsNum"></el-input>
      </el-form-item>
          <el-form-item label="订单类型" prop="orderType">
			<span>{{dataForm.orderType == 1 ? '零售' : dataForm.orderType == 1 ? '批发' : '易物'}}</span>
      </el-form-item>
      </el-form>
  </el-dialog>
</template>

<script>
import debounce from 'lodash/debounce'
export default {
  data () {
    return {
      visible: false,
      dataForm: {
        id: '',
        orderId: '',
        goodsId: '',
        goodsNum: '',
        goodsPrice: '',
        createTime: '',
        sendGoodsNum: '',
        orderType: '',
        checkstaffid: '',
        checkTime: ''
      }
    }
  },
  methods: {
    init () {
      this.visible = true
      this.$nextTick(() => {
        this.$refs['dataForm'].resetFields()
        if (this.dataForm.id) {
          this.getInfo()
        }
      })
    },
    // 获取信息
    getInfo () {
      this.$http.get(`/demo/xlsshoporders/${this.dataForm.id}`).then(({ data: res }) => {
        if (res.code !== 0) {
          return this.$message.error(res.msg)
        }
        this.dataForm = {
          ...this.dataForm,
          ...res.data
        }
      }).catch(() => {})
    }
  }
}
</script>
